import './App.scss';
import React, { createContext, useContext, useState, useEffect } from 'react';
import Player from './commonents/player/Player';

import IndexRouter from './routers/router/indexRouter';

// 创建一个名为ValueContext的上下文对象
export const ValueContext = createContext();

function App() {

  // 定义value和setValue两个状态
  const [value, setValue] = useState('');

  // 定义回调函数，用于更新value状态的值
  const handleValueChange = (newValue) => {
    setValue(newValue);
  };

  useEffect(()=>{console.log('app' + value)},[value])

  return (
    // <ValueContext.Provider value={{ value, onValueChange: handleValueChange }}>
      <div>
        <IndexRouter></IndexRouter>
        <Player></Player>
      </div>
    // </ValueContext.Provider>
  );
}

export default App;